import torch
import os

SEED = 42


def get_generator() -> torch.Generator:
    generator = torch.Generator().manual_seed(SEED)
    return generator


def get_file_dir(file) -> str:
    return os.path.dirname(os.path.abspath(file))

def get_data_dir(file) -> str:
    return f'{get_file_dir(file)}/data/'


def get_device() -> torch.device:
    device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
    return device
